package com.txc.service;

import com.txc.mapper.UserMapper;
import com.txc.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    //service层调用mapper层
    private UserMapper userMapper;


    @Override
    public List<User> queryAll() {
        return userMapper.queryAll();
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public int deleteUser(int id) {
        return userMapper.deleteUser(id);
    }

    @Override
    public User queryOne(int id) {
        return userMapper.queryOne(id);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public int UserCount() {
        return userMapper.UserCount();
    }
}
